package com.Enum;

public enum InfoType {
	Topic(1, "话题"), People(4, "用户"), Question(7, "问题"), Answer(10, "答案"), Law(13, "法律法规"), News(16, "行业动态"), Dynamic(99, "首页动态");
	private final int val;
	private final String desc;

	InfoType(int val, String desc) {
		this.val = val;
		this.desc = desc;
	}

	public int getIntValue() {
		return val;
	}

	public String toString() {
		return desc;
	}

	public static InfoType getByIntValue(int v) {
		switch (v) {
		case 1:
			return Topic;
		case 4:
			return People;
		case 7:
			return Question;
		case 10:
			return Answer;
		case 13:
			return Law;
		case 16:
			return News;
			
		case 99:
			return Dynamic;
		default:
			return null;
		}
	}
}
